package com.hdax.dmw.utils;

import java.io.Serializable;

public class Result<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    private String success;
    //业务码，比如成功、失败、权限不足等 code，可自行定义
    private String errorCode;
    //返回信息，后端在进行业务处理后返回给前端一个提示信息，可自行定义
    private String msg;
    //数据结果，泛型，可以是列表、单个对象、数字、布尔值等
    private T data;

    public String getSuccess() {
        return success;
    }

    public void setSuccess(String success) {
        this.success = success;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public Result() {
    }

    public Result(String resultCode, String msg) {
        this.errorCode = resultCode;
        this.msg = msg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
